package com.qingke.easyjava.demo;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.qingke.easyjava.BeanWrapper;
import com.qingke.easyjava.DemoBean;

public class BeanRefDemo {
	public static void main(String[] args) {
		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("bean1.xml","bean2.xml");
		
		BeanWrapper wrapper = context.getBean("bean",BeanWrapper.class);
		wrapper.getInnerBean().sayHello();
		wrapper.sayHello();
		
		DemoBean bean = context.getBean("demoBean",DemoBean.class);
//		System.out.println(bean.getId());
		System.out.println(bean.toString());
		context.close();
	}
}
